<template>
<div>
  <h1 ref="title">{{msg}}</h1>
  <School ref="sch"/>
  <button @click="show" ref="btn">点我输出ref</button>
</div>
</template>

<script>
import School from "./School";
export default {
  name: "RefShuXing",
  components: {School},
  data() {
    return {
      msg: '欢迎学习Vue！'
    }
  },
  methods: {
    show() {
      console.log(this.$refs.title)
      console.log(this.$refs.sch)
      console.log(this.$refs.btn)
    }
  }
}
</script>

<style scoped>

</style>
